home *** CD-ROM | disk | FTP | other *** search
- /*
- File: StreamLogApp.h
-
- Contains: Include files for the Stream logging application
-
- Copyright: © 1995 by Apple Computer, Inc., all rights reserved.
-
- */
-
- #pragma once
-
- #ifndef __OPENTRANSPORT__
- #include <OpenTransport.h>
- #endif
- #ifndef _MPS_STROPTS_
- #include <stropts.h>
- #endif
- #ifndef _MPS_STREAM_
- #include <mistream.h>
- #endif
- #ifndef _STRLOG_
- #include <strlog.h>
- #endif
-
- #include <LDocApplication.h>
- #include "CTextDoc.h"
-
- #define kBufferSize (1 << 10)
- #define kBufferMask kBufferSize-1
-
- /*******************************************************************************
- ** Private OT APIs
- **
- ** We could use GetMessage, but then we'd have to have a buffer hanging around,
- ** so we use this interface to be more efficient (But it's not portable to
- ** other streams environments).
- ********************************************************************************/
-
- struct OTReadInfo
- {
- UInt32 fType;
- UInt32 fCommand;
- long fSequence;
- size_t fBytes;
- OSStatus fError;
- };
-
- typedef struct OTReadInfo OTReadInfo;
-
- extern "C"
- {
- pascal OTBuffer* OTReadMessage(StreamRef, OTReadInfo*);
- }
-
- /*******************************************************************************
- ** StreamLogApp class
- ********************************************************************************/
-
- class StreamLogApp : public LDocApplication
- {
- public:
- StreamLogApp();
- virtual ~StreamLogApp();
-
- virtual Boolean ObeyCommand(CommandT inCommand, void *ioParam = nil);
- virtual void FindCommandStatus(CommandT inCommand,
- Boolean &outEnabled, Boolean &outUsesMark,
- Char16 &outMark, Str255 outName);
-
- virtual void OpenDocument(FSSpec *inMacFSSpec);
- virtual LModelObject* MakeNewDocument();
- virtual void ChooseDocument();
- virtual void UseIdleTime(const EventRecord &inMacEvent);
-
- virtual void OpenStream(strioctl* stri);
- CTextDoc* fTraceDoc;
- CTextDoc* fErrorDoc;
-
- StreamRef fLogStream;
-
- int fFillPtr[2], fEmptyPtr[2];
- char fBuffer[2][kBufferSize];
- };
-